package day20;

import java.util.HashSet;
import java.util.function.Consumer;

public class t1 {
    public static void main(String[] args) {
        student s1 = new student("张三",18);
        student s2 = new student("李四",19);
        student s3 = new student("王五",20);
        student s4 = new student("张三",18);

        HashSet<student> hs =new HashSet<>();
        System.out.println(hs.add(s1));
        System.out.println(hs.add(s2));
        System.out.println(hs.add(s3));
        System.out.println(hs.add(s4));
        System.out.println(hs);
        hs.forEach(s-> System.out.println(s));
    }
}
